/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.cmc.service.merchant.model.impl;

import com.cmc.service.merchant.model.MerchantEntry;

import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.CacheModel;

import java.io.Serializable;

import java.util.Date;

/**
 * The cache model class for representing MerchantEntry in entity cache.
 *
 * @author ntcuong1
 * @see MerchantEntry
 * @generated
 */
public class MerchantEntryCacheModel implements CacheModel<MerchantEntry>,
	Serializable {
	@Override
	public String toString() {
		StringBundler sb = new StringBundler(41);

		sb.append("{merchantId=");
		sb.append(merchantId);
		sb.append(", companyId=");
		sb.append(companyId);
		sb.append(", creatorUserId=");
		sb.append(creatorUserId);
		sb.append(", createDate=");
		sb.append(createDate);
		sb.append(", modifiedDate=");
		sb.append(modifiedDate);
		sb.append(", type=");
		sb.append(type);
		sb.append(", code=");
		sb.append(code);
		sb.append(", title=");
		sb.append(title);
		sb.append(", description=");
		sb.append(description);
		sb.append(", organization=");
		sb.append(organization);
		sb.append(", organizationId=");
		sb.append(organizationId);
		sb.append(", organizationType=");
		sb.append(organizationType);
		sb.append(", organizationStatus=");
		sb.append(organizationStatus);
		sb.append(", sites=");
		sb.append(sites);
		sb.append(", recursable=");
		sb.append(recursable);
		sb.append(", countryId=");
		sb.append(countryId);
		sb.append(", regionId=");
		sb.append(regionId);
		sb.append(", longitude=");
		sb.append(longitude);
		sb.append(", latitude=");
		sb.append(latitude);
		sb.append(", parentId=");
		sb.append(parentId);
		sb.append("}");

		return sb.toString();
	}

	public MerchantEntry toEntityModel() {
		MerchantEntryImpl merchantEntryImpl = new MerchantEntryImpl();

		merchantEntryImpl.setMerchantId(merchantId);
		merchantEntryImpl.setCompanyId(companyId);
		merchantEntryImpl.setCreatorUserId(creatorUserId);

		if (createDate == Long.MIN_VALUE) {
			merchantEntryImpl.setCreateDate(null);
		}
		else {
			merchantEntryImpl.setCreateDate(new Date(createDate));
		}

		if (modifiedDate == Long.MIN_VALUE) {
			merchantEntryImpl.setModifiedDate(null);
		}
		else {
			merchantEntryImpl.setModifiedDate(new Date(modifiedDate));
		}

		if (type == null) {
			merchantEntryImpl.setType(StringPool.BLANK);
		}
		else {
			merchantEntryImpl.setType(type);
		}

		if (code == null) {
			merchantEntryImpl.setCode(StringPool.BLANK);
		}
		else {
			merchantEntryImpl.setCode(code);
		}

		if (title == null) {
			merchantEntryImpl.setTitle(StringPool.BLANK);
		}
		else {
			merchantEntryImpl.setTitle(title);
		}

		if (description == null) {
			merchantEntryImpl.setDescription(StringPool.BLANK);
		}
		else {
			merchantEntryImpl.setDescription(description);
		}

		merchantEntryImpl.setOrganization(organization);
		merchantEntryImpl.setOrganizationId(organizationId);

		if (organizationType == null) {
			merchantEntryImpl.setOrganizationType(StringPool.BLANK);
		}
		else {
			merchantEntryImpl.setOrganizationType(organizationType);
		}

		merchantEntryImpl.setOrganizationStatus(organizationStatus);
		merchantEntryImpl.setSites(sites);
		merchantEntryImpl.setRecursable(recursable);
		merchantEntryImpl.setCountryId(countryId);
		merchantEntryImpl.setRegionId(regionId);
		merchantEntryImpl.setLongitude(longitude);
		merchantEntryImpl.setLatitude(latitude);
		merchantEntryImpl.setParentId(parentId);

		merchantEntryImpl.resetOriginalValues();

		return merchantEntryImpl;
	}

	public long merchantId;
	public long companyId;
	public long creatorUserId;
	public long createDate;
	public long modifiedDate;
	public String type;
	public String code;
	public String title;
	public String description;
	public boolean organization;
	public long organizationId;
	public String organizationType;
	public int organizationStatus;
	public boolean sites;
	public boolean recursable;
	public long countryId;
	public long regionId;
	public double longitude;
	public double latitude;
	public long parentId;
}